<template lang="pug">
.project-association
  mt-dialog(
    v-model="model"
    cancel-text="取消"
    confirm-text="保存"
    :on-close="updateModel"
    title="日志查看"
  )
  div {{exceptionMessage}}
</template>
  
  <script setup lang="ts">
  import { type EquipmentEntity } from "@scmt/api-lis-equipment";
  import { useRequest } from "@scmt/common-hooks";
  import { useApi } from "@scmt/core-api";
  const updateModel = () => {
    model.value = false;
  };
  const exceptionMessage = ref("");
  const emit = defineEmits(["message-to-parent"]);
  const model = defineModel({
    default: false,
  });
  const $api = useApi();
  
  const { request, data, loadingMap } = useRequest({
    getDevicePushMessageLog: (val: string) => {
    return $api.lis.equipment.getDevicePushMessageLog(val);
  },
  });
  
  const props = defineProps({
    selectEquipment: {
      type: Object as PropType<EquipmentEntity>,
      default: () => {},
    },
  });

  watch(
    () => model.value,
    (item) => {
      if (item) {
        request("getDevicePushMessageLog", props.selectEquipment.id || "")
      }
    },
    {
      immediate: true,
    }
  );
  </script>
  
<style lang="less" scoped></style>
  